import store from "@/store";

export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};

console.log(store.state.custom_dict);
export const formBase = [
  {
    label: "目的地",
    type: "select",
    field: "destinationId",
    optionsKey: "destinationName",
    optionsValue: "destinationId",
    options: store.state.custom_dict.destination,
  },
  {
    label: "店铺",
    type: "select",
    field: "shopId",
    optionsKey: "shopName",
    optionsValue: "id",
    options: store.state.custom_dict.shop,
  },
  {
    label: "联系电话",
    field: "contactPhone",
    type: "input",
  },
  {
    label: "联系人",
    field: "contactName",
    type: "input",
  },
  {
    label: "仓库地址",
    field: "address",
    type: "input",
  },
];
export const tableBase = [
  {
    label: "仓库地址名",
    prop: "name",
    width: 200,
    operate: {
      type: "input",
      field: "name",
    },
  },
  {
    label: "仓库",
    prop: "warehouseName",
    width: 200,
    operate: {
      type: "select",
      field: "warehouseName",
      optionsKey: "warehouseName",
      optionsValue: "warehouseName",
      options: store.state.custom_dict.warehouse,
    },
  },
  {
    label: "目的地",
    prop: "destinationName",
    width: 200,
    operate: {
      type: "select",
      field: "destinationId",
      optionsKey: "destinationName",
      optionsValue: "destinationId",
      options: store.state.custom_dict.destination,
    },
  },
  {
    label: "店铺",
    prop: "shopName",
    width: 200,
    operate: {
      type: "select",
      field: "shopId",
      optionsKey: "shopName",
      optionsValue: "id",
      options: store.state.custom_dict.shop,
    },
  },
  {
    label: "联系人",
    prop: "contactName",
    width: 200,
    operate: {
      type: "input",
      field: "contactName",
    },
  },
  {
    label: "联系电话",
    prop: "contactPhone",
    width: 200,
    operate: {
      type: "input",
      field: "contactPhone",
    },
    rules: [{ reg: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/ }],
  },
  {
    label: "联系邮编",
    prop: "zipCode",
    width: 200,
    operate: {
      type: "input",
      field: "zipCode",
    },
  },
  {
    label: "备注",
    prop: "remarks",
    width: 200,
    operate: {
      type: "input",
      field: "remarks",
    },
  },
  {
    label: "地址",
    prop: "address",
    operate: {
      type: "input",
      field: "address",
    },
  },
];
